package com.dilidili.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * @PackgeName: com.jab.config
 * @ClassName: SecurityConfig
 * @Author: 零
 * Date: 2022/3/22 15:49
 * project name: SpringCloud-Exercise
 * @Version:
 * @Description: security配置 主要用来在spring容器中放AuthenticationManager对象以便在授权配置中获取该对象
 */
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    /**
     * 向spring容器放入一个对象AuthenticationManager对象,供oauth使用
     */
    @Bean
    public AuthenticationManager getManager() throws Exception {
        return super.authenticationManager();
    }

}

